/**
 * 英雄区域粒子效果初始化
 */
document.addEventListener('DOMContentLoaded', function() {
    // 检查是否存在hero-particles元素
    const heroParticles = document.querySelector('.hero-particles');
    if (!heroParticles) return;
    
    // 创建粒子效果
    function createParticles() {
        const particleCount = 50;
        
        for (let i = 0; i < particleCount; i++) {
            const particle = document.createElement('div');
            particle.className = 'particle';
            
            // 随机位置
            const x = Math.random() * 100;
            const y = Math.random() * 100;
            
            // 随机大小
            const size = Math.random() * 5 + 1;
            
            // 随机透明度
            const opacity = Math.random() * 0.5 + 0.3;
            
            // 随机动画延迟
            const delay = Math.random() * 5;
            
            // 设置样式
            particle.style.cssText = `
                top: ${y}%;
                left: ${x}%;
                width: ${size}px;
                height: ${size}px;
                background-color: rgba(255, 255, 255, ${opacity});
                animation: float 15s infinite ease-in-out ${delay}s;
            `;
            
            heroParticles.appendChild(particle);
        }
    }
    
    // 初始化粒子
    createParticles();
});